home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / likene1a / myprog4.frm < prev    next >
Text File  |  1999-09-24  |  5KB  |  185 lines

  1. VERSION 5.00
  2. Begin VB.Form Form2 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Windows stuff"
  5.    ClientHeight    =   720
  6.    ClientLeft      =   4845
  7.    ClientTop       =   3660
  8.    ClientWidth     =   2640
  9.    ControlBox      =   0   'False
  10.    BeginProperty Font 
  11.       Name            =   "Arial"
  12.       Size            =   8.25
  13.       Charset         =   0
  14.       Weight          =   700
  15.       Underline       =   0   'False
  16.       Italic          =   0   'False
  17.       Strikethrough   =   0   'False
  18.    EndProperty
  19.    LinkTopic       =   "Form2"
  20.    MaxButton       =   0   'False
  21.    MinButton       =   0   'False
  22.    ScaleHeight     =   720
  23.    ScaleWidth      =   2640
  24.    ShowInTaskbar   =   0   'False
  25.    Begin VB.CommandButton Command1 
  26.       Caption         =   "Exit"
  27.       Height          =   375
  28.       Left            =   1320
  29.       TabIndex        =   3
  30.       Top             =   360
  31.       Width           =   1335
  32.    End
  33.    Begin VB.CommandButton Command4 
  34.       Caption         =   "Shut down"
  35.       Height          =   375
  36.       Left            =   1320
  37.       TabIndex        =   2
  38.       Top             =   0
  39.       Width           =   1335
  40.    End
  41.    Begin VB.CommandButton Command5 
  42.       BackColor       =   &H00C0C0C0&
  43.       Caption         =   "hide toolbar"
  44.       Height          =   375
  45.       Left            =   0
  46.       TabIndex        =   1
  47.       Top             =   360
  48.       Width           =   1335
  49.    End
  50.    Begin VB.CommandButton Command24 
  51.       BackColor       =   &H00C0C0C0&
  52.       Caption         =   "Dis Ctrl/Alt/Del"
  53.       Height          =   375
  54.       Left            =   0
  55.       TabIndex        =   0
  56.       Top             =   0
  57.       Width           =   1335
  58.    End
  59. End
  60. Attribute VB_Name = "form2"
  61. Attribute VB_GlobalNameSpace = False
  62. Attribute VB_Creatable = False
  63. Attribute VB_PredeclaredId = True
  64. Attribute VB_Exposed = False
  65. Dim mmflag As Boolean
  66. Dim sax As Integer
  67. Dim Say As Integer
  68.  
  69. Private Declare Function mciSendString Lib "winmm.dll" Alias _
  70. "mciSendStringA" (ByVal lpstrCommand As String, ByVal _
  71. lpstrReturnString As String, ByVal uReturnLength As Long, _
  72. ByVal hwndCallback As Long) As Long
  73.  
  74. Private Type RECT
  75.     Left As Long
  76.     Top As Long
  77.     Right As Long
  78.     Bottom As Long
  79. End Type
  80.  
  81. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
  82.    (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  83.  Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, _
  84.    ByVal nCmdShow As Long) As Long
  85.  
  86.  Private Const SW_HIDE = 0
  87.  Private Const SW_SHOWNORMAL = 1
  88.  
  89. Private Sub Command1_Click()
  90. Form12.Show
  91. Unload form2
  92. End Sub
  93.  
  94. Private Sub Command20_Click()
  95. Load DirControls
  96. DirControls.Show
  97. End Sub
  98.  
  99. Private Sub Command24_Click()
  100. If Command24.Caption = "Dis Ctrl/Alt/Del" Then
  101. Command24.Caption = "en Ctrl/Alt/Del"
  102. Else
  103. Command24.Caption = "Dis Ctrl/Alt/Del"
  104. End If
  105. If Command24.Caption = "en Ctrl/Alt/Del" Then
  106. Dim Ret As Integer
  107. Dim pOld As Boolean
  108. Ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, pOld, 0)
  109. End If
  110. If Command24.Caption = "Dis Ctrl/Alt/Del" Then
  111. Ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, pOld, 0)
  112. End If
  113. End Sub
  114.  
  115. Private Sub Command25_Click()
  116.    Call ImplodeForm(Me, 2, 500, 1)
  117.     Unload form2
  118.     Form1.Show
  119.     
  120. End Sub
  121.  
  122. Private Sub Command3_Click()
  123.  
  124. End Sub
  125.  
  126. Private Sub Command4_Click()
  127. Dim temp
  128. temp = ExitWindowsEx(EWX_SHUTDOWN, 0)
  129. End Sub
  130.  
  131. Private Sub Command5_Click()
  132. If Command5.Caption = "hide toolbar" Then
  133. Command5.Caption = "show toolbar"
  134. Else
  135. Command5.Caption = "hide toolbar"
  136. End If
  137. If Command5.Caption = "show toolbar" Then
  138.    Dim Ret         As Long
  139.    Dim ClassName   As String
  140.    Dim StartWindow As Long
  141.    ClassName = Space(256)
  142.    ClassName = "Shell_TrayWnd"
  143.    StartWindow = FindWindow(ClassName, vbNullString)
  144.  
  145.    Ret = ShowWindow(StartWindow, SW_HIDE)
  146.    
  147.    End If
  148.   If Command5.Caption = "hide toolbar" Then
  149.      ClassName = Space(256)
  150.    ClassName = "Shell_TrayWnd"
  151.    StartWindow = FindWindow(ClassName, vbNullString)
  152.  
  153.    
  154.    Ret = ShowWindow(StartWindow, SW_SHOWNORMAL)
  155.   
  156.    End If
  157. End Sub
  158.  
  159. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  160.    Dim fml As Long
  161.    Dim fmt As Long
  162.    Dim a As Integer
  163.    If mmflag = True Then
  164.       fml = Me.Left: fmt = Me.Top
  165.       If X > sax Then Me.Left = fml + (X - sax)
  166.         If X < sax Then Me.Left = fml - (sax - X)
  167.       If Y > Say Then Me.Top = fmt + (Y - Say)
  168.       If Y < Say Then Me.Top = fmt - (Say - Y)
  169.    End If
  170.    End Sub
  171.  
  172. Private Sub form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  173. If mmflag = False Then
  174.       sax = X
  175.       Say = Y
  176.       mmflag = True
  177.    End If
  178.    Me.MousePointer = vbSizePointer
  179.    End Sub
  180.  
  181. Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  182.     mmflag = False
  183.    Me.MousePointer = vbDefault
  184. End Sub
  185.